import request from '../request'
// ------------------------
// 用户地址 列表
export const getAddressList = (params = {}) => {
    return request({
        url: "/system/address/list",
        method: "get",
        params: params,
        methodType: "jsonStr",
    });
};

// 添加地址
export const addAddress = (data) => {
    return request({
        url: "/system/address/add",
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

// 删除地址
export const deleteAddress = (id) => {
    return request({
        url: `/system/address/delete?id=${id}`,
        method: "post",
        methodType: "jsonStr",
    });
};

// 修改地址
export const updateAddress = (data) => {
    var url = data.id ? "/system/address/update" : "/system/address/add";
    return request({
        url: url,
        method: "post",
        data: data,
        methodType: "jsonStr",
    });
};

